#coding=utf-8
'''
Created on 2017年12月12日
@attention: 从txt读取内容并分词
@author: yqm
'''
import jieba
import jieba.posseg as pseg
fileNeedCut = 'G:/experiment/Word2vec/result.txt'
fileName = 'G:/experiment/jieba/result.txt'

fn = open(fileNeedCut, "r", encoding="utf-8")
f = open(fileName, "w+", encoding="utf-8")
for line in fn.readlines():
    #words = pseg.cut(line) #带分词的词性
    words = jieba.cut_for_search(line) #只是分词,不带词性
    for w in words:
        print(w, file=f)
f.close()
fn.close()















